package code.c11;

import javax.swing.*;
import java.awt.*;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/11/17 10:15
 * @package code.c11
 * @description 自定义 JFrame
 */

public class MyFrame extends JFrame {
    public MyFrame(String title) throws HeadlessException {
        super.setTitle(title);
        this.init();
    }

    public void init() {
        super.setSize(485, 300);

        JPanel jPanel = new JPanel();
        jPanel.setLayout(new GridLayout(3,3));

        super.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        super.setLayout(new BorderLayout());
        JButton button_1 = new JButton("button_1");
//        JButton button_2 = new JButton("button_2");
//        JButton button_3 = new JButton("button_3");
//        JButton button_4 = new JButton("button_4");
//        JButton button_5 = new JButton("button_5");

        jPanel.add(button_1);
//        jPanel.add(button_2);
//        jPanel.add(button_3);
//        jPanel.add(button_4);
//        jPanel.add(button_5);

        super.add(jPanel);


        super.setVisible(true);
    }
}
